package com.onefinger.repository;

import java.io.IOException;

import org.codehaus.jackson.JsonGenerator;
import org.codehaus.jackson.JsonProcessingException;
import org.codehaus.jackson.map.JsonSerializer;
import org.codehaus.jackson.map.SerializerProvider;

import com.onefinger.domain.Identificable;

public class IdJsonSerializer extends JsonSerializer<Identificable> {

	@Override
	public void serialize(Identificable value, JsonGenerator jgen,
			SerializerProvider provider) throws IOException,
			JsonProcessingException {

			String id = value.getId().toString();
			 
	        jgen.writeString(id);		
	}

}
